package com.gsi.webstore.platform.storefront.internal.order;

import java.math.BigDecimal;
import java.util.List;

import com.gsi.webstore.platform.adapter.taxes_duties_fees.capi.calculation.ComputedTaxInfoItem;
import com.gsi.webstore.platform.adapter.taxes_duties_fees.capi.v1.TaxesDutiesCalculationServiceRule;
import com.gsi.webstore.platform.storefront.capi.order.GSITaxInformationBO;
import com.intershop.beehive.core.capi.localization.LocaleInformation;
import com.intershop.beehive.foundation.quantity.Money;

public class GSITaxInformationBOImpl implements GSITaxInformationBO
{
    private ComputedTaxInfoItem _ctii;

    public GSITaxInformationBOImpl(ComputedTaxInfoItem ctii)
    {
        this._ctii = ctii;
    }

    @Override
    public Money getAmount()
    {
        return getTaxableAmount();
    }

    @Override
    public String getDisplayName()
    {
        return getImposition();
    }

    @Override
    public String getDisplayName(LocaleInformation local)
    {
        throw new UnsupportedOperationException("No locale specific display name available.");
    }
    
    @Override
    public String getShortDisplayName()
    {
        return getImposition();
    }

    @Override
    public String getShortDisplayName(LocaleInformation arg0)
    {
        throw new UnsupportedOperationException("No locale specific short display name available.");
    }

    @Override
    public String getDescription(LocaleInformation local)
    {
        throw new UnsupportedOperationException("No locale specific description available.");
    }

    public String getID()
    {
        return _ctii.getID();
    }

    public String getDescription()
    {
        return _ctii.getDescription();
    }

    public String getHTSCode()
    {
        return _ctii.getHTSCode();
    }

    public String getTaxClass()
    {
        return _ctii.getTaxClass();
    }

    public String getTaxType()
    {
        return _ctii.getTaxType();
    }

    public String getTaxability()
    {
        return _ctii.getTaxability();
    }

    public String getSitus()
    {
        return _ctii.getSitus();
    }

    public String getJurisdiction()
    {
        return _ctii.getJurisdiction();
    }

    public String getJurisdictionLevel()
    {
        return _ctii.getJurisdictionLevel();
    }

    public String getJurisdictionID()
    {
        return _ctii.getJurisdictionID();
    }

    public String getImposition()
    {
        return _ctii.getImposition();
    }

    public String getImpositionType()
    {
        return _ctii.getImpositionType();
    }

    public BigDecimal getEffectiveRate()
    {
        return _ctii.getEffectiveRate();
    }

    public Money getTaxableAmount()
    {
        return _ctii.getTaxableAmount();
    }

    public Money getCalculatedTax()
    {
        return _ctii.getCalculatedTax();
    }

    public String getSellerRegistrationID()
    {
        return _ctii.getSellerRegistrationID();
    }

    public List<String> getInvoiceTextCodes()
    {
        return _ctii.getInvoiceTextCodes();
    }

    public Boolean isTaxable()
    {
        return new Boolean(getTaxability().equals(TaxesDutiesCalculationServiceRule.TAXABILITY_TAXABLE));
    }
    
    public Boolean isCalculationError()
    {
        return _ctii.isCalculationError();
    }
}